### Eclipse Workspace Patch 1.0
#P JOSM
Index: src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingTextField.java
===================================================================
--- src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingTextField.java	(revision 4088)
+++ src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingTextField.java	(working copy)
@@ -21,7 +21,6 @@
 import javax.swing.text.StyleConstants;
 
 import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionList;
 import org.openstreetmap.josm.gui.util.TableCellEditorSupport;
 
 /**
@@ -97,10 +96,9 @@
                 remove(0,getLength());
                 super.insertString(0,matchingString,a);
 
-                // highlight from end to insert position
-                //
-                setCaretPosition(getLength());
-                moveCaretPosition(offs + str.length());
+                // highlight from insert position to end position to put the caret at the end
+                setCaretPosition(offs + str.length());
+                moveCaretPosition(getLength());
             } else {
                 // there are no matches. Insert the new text, do not highlight
                 //
